#include <iostream>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

int a[100010];
int b[100010];
int n;
map<int, int, greater<int>> mp; //利用map的有序直接计算

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        b[i] = a[i];
        mp[a[i]]++;
    }
    // sort(b + 1, b + 1 + n, cmp);
    int rank = 1;
    int count = 1;
    for (auto &it : mp)
    {
        auto temp = it.second;
        it.second = rank;
        rank += temp;
    }
    for (int i = 1; i <= n; i++)
    {
        cout << mp[a[i]] << " ";
    }
    cout << endl;
    //system("pause");
    return 0;
}